package com.chinabank.util;

import java.io.IOException;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

public class Base64 {
	public static String encode(byte src[]){
        BASE64Encoder encoder = new BASE64Encoder();
        return encoder.encode(src);
    }
	
	 public static byte[] decode(String base64) {
        BASE64Decoder decoder = new BASE64Decoder();
        try {
			return decoder.decodeBuffer(base64);
		} catch (IOException e) {
			e.printStackTrace();
		}
        return null;
    }
}
